//
//  LocalModel.m
//  DolphinMusic
//
//  Created by liuhaiyang on 15/4/1.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "LocalModel.h"

@implementation LocalModel

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
    [_button release];
    [_label release];
    [_view release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame image:(NSString *)image labelText:(NSString *)labelText
{
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat width = frame.size.width;
        CGFloat width1 = width - 30;
        
        
        
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        self.button.frame = CGRectMake(width * 3 / 10, width * 3 / 10, width * 2 / 5, width * 2 / 5);
        [self.button setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
        [self addSubview:self.button];
        
        
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, width1, width, 30)];
        self.label.textColor = [UIColor whiteColor];
        self.label.font = [UIFont systemFontOfSize:15];
        self.label.text = labelText;
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.alpha = 0.8;
        [self addSubview:self.label];
        [_label release];
        
        self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, width)];
        self.view.backgroundColor = [UIColor whiteColor];
        self.view.layer.cornerRadius = 8;
        self.view.alpha = 0.2;
        [self addSubview:self.view];
        [_view release];
        
        
    }
    return self;
}


@end
